Lock
TheLock
method locks this link object, ensuring exclusive read-only access to its content storage unit.
ODBoolean Lock (in ODULong wait, out ODLinkKey key);
wait
- The interval to wait for access to be granted.
key
- If access is granted, a valid link key; otherwise an undefined, invalid key.
- return value
kODTrue
if access is granted, otherwisekODFalse
.DISCUSSION
To ensure thread-safe access, you must call this method to acquire a valid link key before you can read the link data. This method grants read-only access; a destination part cannot modify a link's content.The
wait
parameter specifies the time you are willing to wait for access to be granted. A value of 0 means no wait and is the only value accepted on the Mac OS platform. If thewait
argument is nonzero and the lock cannot be granted, theLock
method returnskODFalse
immediately. Other platforms may accept other values with platform-dependent meanings.A link may be locked by only one object at a time; nested calls to the
Lock
method deny access.While your part has the link locked, you must pass the key returned in the
key
output parameter to all methods that access the link. When you are finished using the link, you must pass this key to theUnlock
method to unlock the link.EXCEPTIONS
kODErrBrokenLink
- Internal error; the link-source object disconnected from its destinations.
SEE ALSO
TheODLinkKey
type (page 924).
TheODLink::GetContentStorageUnit
method (page 352).
TheODLink::Unlock
method (page 360).
"Manipulating Links" on page 380 in OpenDoc Programmer's Guide.
"Updating a Link at the Destination" on page 384 in OpenDoc Programmer's Guide.
Main | Page One | What's New | Apple Computer, Inc. | Find It | Contact Us | Help